package users;

import main.SessionManager;
import DBClasses.User;

public class UserServiceImpl implements UserService
{

	public boolean isUserLoggedIn() {
		 
        // request.getSession(true).getAttribute("user")

        if ((SessionManager.getSession() != null)

                  && (SessionManager.getSession().getAttribute("username") != null)) {

             return true;

        } else {

             return false;

        }

   }



   public void login(User user) {

        // TODO Auto-generated method stub

   }



   public String getUsername() {

        if (SessionManager.getSession() != null) {

             if (SessionManager.getSession().getAttribute("username") != null)

                  return (String) SessionManager.getSession().getAttribute(

                            "username");

        }

        return "Guest";

   }

}
